<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="DocType.aspx.cs" Inherits="DocType" title="Project Monitoring System" culture="auto:en-US" uiculture="auto" meta:resourcekey="PageResource1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server" Visible="false">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <asp:ObjectDataSource ID="ODSDocType" runat="server" DeleteMethod="Delete" InsertMethod="Insert"
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetDocTypeBySection" TypeName="IPTableAdapters.DocumentTypeTableAdapter"
        UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="Original_Section" Type="String" />
            <asp:Parameter Name="Original_Type" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Section" Type="String" />
            <asp:Parameter Name="Type" Type="String" />
            <asp:Parameter Name="TypeSeq" Type="String" />
            <asp:Parameter Name="Folder" Type="String" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="Original_Section" Type="String" />
            <asp:Parameter Name="Original_Type" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="Section" Type="String" />
            <asp:Parameter Name="TypeSeq" Type="String" />
            <asp:Parameter Name="Type" Type="String" />
            <asp:Parameter Name="Folder" Type="String" />
            <asp:Parameter Name="CreateBy" Type="String" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="OwnerGroupID" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:Parameter Name="Section" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <div style="margin-left:10px;margin-right:10px;">
        <fieldset>
            <legend><asp:Label ID="lblDocTypeAdd" runat="server" Text="Edit Document Type" meta:resourcekey="lblDocTypeResource1"></asp:Label></legend>
            <table>
                <tr>
                    <td>
                        <asp:Label ID="lblSection" runat="server" Text="Section" meta:resourcekey="lblSectionResource1"></asp:Label></td>
                    <td>
                        <asp:DropDownList ID="ddlSection" runat="server" CssClass="required" Width="155px" meta:resourcekey="ddlSectionResource1"></asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlSection" Display="Dynamic" ErrorMessage="Section is a required field." meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator>
                        <asp:ObjectDataSource ID="ODSSections" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetDocSectionData" TypeName="IPTableAdapters.DocumentSectionTableAdapter"></asp:ObjectDataSource>
                    </td>
                    <td>
                        <asp:Label ID="lblTypeSeq" runat="server" Text="Type Sequence" meta:resourcekey="lblTypeSeqResource1"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtTypeSeq" runat="server" meta:resourcekey="txtTypeSeqResource1" MaxLength="30"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblType" runat="server" Text="Type" meta:resourcekey="lblTypeResource1"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtType" runat="server" CssClass="required" meta:resourcekey="txtTypeResource1" MaxLength="100" Width="287px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtType"
                            Display="Dynamic" ErrorMessage="Type is a required field." meta:resourcekey="RequiredFieldValidator2Resource1"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                        <asp:Label ID="lblFolder" runat="server" Text="Folder" meta:resourcekey="lblFolderResource1"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtFolder" runat="server" Width="418px" meta:resourcekey="txtFolderResource1" MaxLength="150"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblGrouptype" runat="server" Text="Group Type:" meta:resourcekey="lblGroupTypeResource1"></asp:Label>
                    </td>
                    <td colspan="3" valign="top">
                        <input type="hidden" id="hidSession" runat="server" />
                        <asp:Repeater ID="rptGroupType" runat="server" OnItemDataBound="rptGroupType_ItemDataBound">
                        <ItemTemplate>                  
                        <asp:CheckBox Text='<%# Eval("Code")%>'  CssClass="GroupcodeStyle" runat="server" id="chkGroupTP" />
                        </ItemTemplate>                    
                        </asp:Repeater>                    
                    </td>                       
                </tr>
                <tr>
                    <td style="text-align: center;" colspan="4">
                        <asp:Button ID="btnNew" runat="server" CssClass="submit" Text="New" OnClick="btnNew_Click"
                            CausesValidation="False" meta:resourcekey="btnNewResource1" />
                        <asp:Button ID="btnModify" runat="server" CssClass="submit" Text="Edit" OnClick="btnModify_Click"
                            CausesValidation="False" meta:resourcekey="btnModifyResource1" />
                        <asp:Button ID="btnSave" runat="server" CssClass="submit" Text="Save" OnClick="btnSave_Click"
                            meta:resourcekey="btnSaveResource1" />
                        <asp:Button ID="btnDelete" runat="server" CausesValidation="False" CssClass="submit"
                            OnClick="btnDelete_Click" Text="Delete" meta:resourcekey="btnDeleteResource1" />
                        <asp:Button ID="btnCancel" runat="server" CssClass="reset" Text="Cancel" OnClick="btnCancel_Click"
                            CausesValidation="False" meta:resourcekey="btnCancelResource1" />
                    </td>
                </tr>
            </table>
            <asp:CheckBox ID="chkForOperation" runat="server" Visible="False" meta:resourcekey="chkForOperationResource1" />
            <asp:CheckBox ID="cbForUpdate" runat="server" Height="2px" Visible="False" Width="121px" meta:resourcekey="cbForUpdateResource1" />
        </fieldset>
        <table width="100%">
            <tr>
                <td align="center">
                    <asp:Label ID="lblError" runat="server" CssClass="error" ForeColor="Red" Width="100%" meta:resourcekey="lblErrorResource1"></asp:Label>
                </td>
            </tr>
        </table>
	    <asp:Panel ID="Panel1" runat="server" Height="400px" Width="100%" meta:resourcekey="Panel1Resource1">
            <asp:GridView CssClass="Grid" ID="gvDocType" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                BackColor="#DEBA84" BorderColor="#660000" GridLines="Both" BorderStyle="Solid" BorderWidth="1px"
                CellPadding="0" CellSpacing="0"  Width="100%"
                DataKeyNames="Section,Type,TypeSeq,Folder" DataSourceID="ODSDocType"
                AllowPaging="True" PageSize="20" meta:resourcekey="gvDocTypeResource1" 
                OnSelectedIndexChanged="gvDocType_SelectedIndexChanged" 
                OnRowCreated="gvDocType_RowCreated">
                <Columns>
                    <asp:BoundField DataField="Section" Visible="false" HeaderText="Section" ReadOnly="True" SortExpression="Section" HeaderStyle-Width="100" meta:resourcekey="BoundFieldResource1"/>
                    <asp:BoundField DataField="SectionName" HeaderText="Section" ReadOnly="True" SortExpression="Section" HeaderStyle-Width="200" meta:resourcekey="BoundFieldResource1"/>
                    <asp:BoundField DataField="TypeSeq" HeaderText="Type Sequence" SortExpression="TypeSeq" HeaderStyle-Width="100" meta:resourcekey="BoundFieldResource2"/>
                    <asp:BoundField DataField="Type" HeaderText="Type" ReadOnly="True" SortExpression="Type" HeaderStyle-Width="200" meta:resourcekey="BoundFieldResource3"/>
                    <asp:BoundField DataField="Folder" HeaderText="Folder" SortExpression="Folder" HeaderStyle-Width="300" meta:resourcekey="BoundFieldResource4"/>
                    <asp:BoundField DataField="CreateBy" HeaderText="Create By" SortExpression="CreateBy" HeaderStyle-Width="100" meta:resourcekey="BoundFieldResource5" />
                    <asp:BoundField DataField="UpdateBy" HeaderText="Update By" SortExpression="UpdateBy" HeaderStyle-Width="100" meta:resourcekey="BoundFieldResource6" />
                    <asp:BoundField DataField="OwnerGroupID" HeaderText="OwnerGroupID" SortExpression="OwnerGroupID" Visible="False" meta:resourcekey="BoundFieldResource7" />
                    <asp:CommandField ShowSelectButton="True" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="center" ItemStyle-CssClass="btnEdit" meta:resourcekey="CommandFieldResource1" />
                </Columns>
                <HeaderStyle CssClass="GridHeaderStyle" ForeColor="White" />
                <RowStyle CssClass="GridRowStyle"/>
                <AlternatingRowStyle CssClass="GridAltRowStyle"/>
			    <SelectedRowStyle CssClass="GridSelectedRowStyle"/>
                <PagerStyle CssClass="GridPagerStyle" ForeColor="White"/>
                <FooterStyle CssClass="GridFooterStyle" BackColor="#F7DFB5" ForeColor="#8C4510" />
            </asp:GridView>
        </asp:Panel>
    </div>
</asp:Content>

